package util
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;

	public class DisplayUtil
	{
		public static function  removeAll(container:DisplayObjectContainer, excludes:Array = null):void
		{
			var index:int = container.numChildren - 1;
			while(index >= 0)
			{
				var child:DisplayObject = container.getChildAt(index);
				if(excludes == null || excludes.indexOf(child) < 0)
				{
					container.removeChildAt(index);
				}
				index--;
			}
		}
	}
}